package com.zhny.iot.okq.soil.plugin;

import com.zhny.aiot.plugin.ICenterFacilities;
import com.zhny.aiot.plugin.IDevice;
import com.zhny.aiot.plugin.model.DeviceEntity;
import com.zhny.aiot.plugin.model.FactoryType;
import com.zhny.aiot.plugin.model.StoreEntity;
import com.zhny.aiot.plugin.web.WebDeviceFactory;
import org.pf4j.Extension;
import org.pf4j.Plugin;
import org.pf4j.PluginWrapper;

public class OKQSoilPlugin extends Plugin {
    public OKQSoilPlugin(PluginWrapper wrapper) {
        super (wrapper);
    }
    @Extension
    public static class OKQSoilFactory extends WebDeviceFactory {

        @Override
        public Class configClass() {
            return OKQConfig.class;
        }

        public IDevice createDevice(ICenterFacilities iCenterFacilities, DeviceEntity entity) {
            return new OKQDevice(this, iCenterFacilities, entity);
        }

        public Class<? extends StoreEntity> storeClass() {
            return OKQSoilStoreEntry.class;
        }

        public String getId() {
            return "okq-iot-soil";
        }

        public String getName() {
            return "欧克奇土壤墒情设备插件";
        }

        public FactoryType getType() {
            return FactoryType.SoilMoisture;
        }
    }
}
